<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/header.jsp"%>
<div id="content" class="col-lg-10 col-sm-10">
	<div>
		<ul class="breadcrumb">
			<li><a href="#">基础信息</a></li>
			<li><a href="#">物资类别</a></li>
		</ul>
	</div>
	<button class="btn btn-primary noty" id="error-tip" 
	data-noty-options style="display:none;"></button>
	<div class=" row">
			<div class="box col-md-12">
				<div class="box-inner">
					<div class="box-header well" data-original-title="">
						<h2>
							<i class="fa fa-leaf"></i> 物资类别信息
						</h2>

						<div class="box-icon">
							<a  title="新增类别" 
								data-toggle="tooltip" > <i
								class="glyphicon glyphicon-plus typeadd"></i></a>
						</div>
					</div>
					<form class="form-horizontal" action="${pageContext.request.contextPath}/base/typelist.html" method="POST">
							<input type="hidden" name="pageIndex" value="1" />
					</form>
					
					<div class="box-content">
						<div class="alert alert-info">
							<em>**</em>注意<em>**</em>:<br>
							1.物资类别属于WMS的关键信息,故不提供界面删除功能;如需要,请使用sql脚本执行<br>
							2.物资类别修改严格遵循数据库设计规范,请谨慎使用!
						</div>
						<a class="btn btn-success typeadd">新增类别</a>
						</br>
						<table class="table table-striped table-bordered responsive">
							<thead>
								<tr>
									<th>序号</th>
									<th>类型编号</th>
									<th>类型名称</th>
									<th>类型数值</th>
									<th>类型描述</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${typelist}" var="type" varStatus="getIndex">
									<tr>

										<td class="center">${getIndex.index+1}</td>
										<td class="center">${type.typeCode}</td>
										<td class="center">${type.typeName}</td>
										<td class="center">${type.valueId}</td>
										<td class="center">${type.valueName}</td>
										<td class="center">
											<fmt:formatDate value="${type.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
											
										</td>
										
										<td class="center"><a class="btn btn-info typeedit"
											type-code="${type.typeCode}"
											type-valueid = "${type.valueId}"
											url="${pageContext.request.contextPath}/">
											<i class="glyphicon glyphicon-edit icon-white"></i>修改
										</a> 
										</td>

									</tr>
								</c:forEach>
							</tbody>
						</table>

						<div class="col-md-12">
							<div class="dataTables_info" id="DataTables_Table_0_info">
								共${pages.getTotal()}条记录
							${pages.getPageNum()}/${pages.getPages()}页</div>
						</div>

						<div class="col-md-12 center-block">
							<div class="dataTables_paginate paging_bootstrap pagination">
								<ul class="pagination">
								<c:if test="${pages.getPageNum() > 1}">
									<li class="prev"><a
										href="javascript:page_nav(document.forms[0],1);">首页</a>
									</li>
									<li class=""><a
										href="javascript:page_nav(document.forms[0],${pages.getPageNum()-1});">上一页</a>
									</li>
								</c:if>
								<c:if test="${pages.getPageNum() < pages.getTotal()}">
									<li class="paginate_button"><a
										href="javascript:page_nav(document.forms[0],${pages.getPageNum()+1});">下一页</a>
									</li>
									<li class="paginate_button next"><a
										href="javascript:page_nav(document.forms[0],${pages.getTotal()});">末页</a>
									</li>
								</c:if>
							</ul>
							</div>
						</div>

					</div>
				</div>
			</div>
			<!--/span-->
</div>
</div>


<!-- 新增模态框 -->
<div class="modal fade" id="addType" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true"  data-backdrop="static">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	            	<form id="typeAddForm" action="${pageContext.request.contextPath}/basic/type/saveadd" method="POST">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>新增物资类别</h3>
	                </div>
	                <div class="modal-body">
	                   	<ul id="add-errtip" class="alert alert-info">
	                   		tip: 为了便于统一管理, 强烈建议您使用大写英文字母和下划线组合作为类型编号
	                   	</ul>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span>类型编号:</span>
                  				<input type="text" value="GOODS_TYPE" readonly="readonly"  name="typeCode" class="form-control"/>
                  		</div>	
             
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>类型名称</span>
                  				<input type="text" name="typeName" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>数据数值:</span>
                  				<input type="number"  name="valueId" class="form-control" required="required"/>
                  				
                  		</div>
                  			<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>数据描述:</span>
                  				<input type="text"  name="valueName" class="form-control" required="required"/>
                  				
                  		</div>
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">取消</a>
	              		<button type="submit" class="btn btn-primary">添加</button>

	                </div>
	                 </form>
	            </div>
	        </div>
       
    </div>


 <div class="modal fade" id="modifyType" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true" data-backdrop="static">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	            	<form id="modifyForm" action="${pageContext.request.contextPath}/basic/type/savemodify" method="POST">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>修改物资类别信息</h3>
	                </div>
	                <div class="modal-body">
	                   	<ul id="modify-errtip" class="alert alert-info" style="display:none;"></ul>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span >类型编号:</span>
                  				<input type="text" readonly="readonly" id="m_typeCode" name="typeCode" class="form-control"/>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>类型名称:</span>
                  				<input type="text" id="m_typeName" name="typeName" class="form-control" readonly="readonly"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>数据数值:</span>
                  				<input type="text" readonly="readonly" id="m_valueId" name="valueId" class="form-control"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >数据描述:</span>
                  				<input type="text" id="m_valueName" name="valueName" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>创建时间</span>
                  				<input type="datetime" id="m_createDate" name="createDate" class="form-control" readonly="readonly"/>
                  				
                  		</div>  
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >创建人:</span>
                  				<input type="text" id="m_createBy" name="createBy" class="form-control" readonly="readonly"/>
                  				
                  		</div>    
                  			
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">关闭</a>
	              		<button type="submit" class="btn btn-primary">保存修改</button>
	                </div>
	                 </form>
	            </div>
	        </div>
       
    </div>
<%@ include file="../common/footer.jsp"%>
<script src="${pageContext.request.contextPath}/statics/local/js/typelist.js"></script>




